<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script type="text/javascript" src="../js/vue.js"></script>
</head>
<body>
<div id="root">
<h1>{{msg}}</h1>
    <school></school>
</div>
</body>
<script type="text/javascript">
    Vue.config.productionTip=false
    //定义组件
    const school =Vue.extend({
        template:"<div><h2>学校名称{{name}}</h2><h2>学校地址{{address}}</h2></div>",
        data(){
            return{
                name:'山海经',
                address:"上海"
            }
        }
    })

    new Vue({
        el:'#root',
        data:{
            msg:'欢迎'
        },
        components:{
            school:school
        }
    })
</script>
</html>